﻿using Hotel_Project.Bean;
using Hotel_Project.Tools.BrushMenuStrip;
using Hotel_Project.Tools.MySqlData_Helps;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Hotel_Project.BIZ
{
    /// <summary>
    /// 初始化节点
    /// </summary>
    internal class AddMenuStrip
    {
        
        public AddMenuStrip()
        {

        }
        public async void AddListMenuStrip(MenuStrip menuStrip,TabControl t)
        {
            //动态抓取数据库中的数据
            MySqlDataTable mySqlDataTable = new MySqlDataTable();
            DataTable data = await mySqlDataTable.GetDataTable(MySqlString.MYSQL_CONNAND, MySqlString.MYSQL_SELECT_st);
            List<MenuStripDomain> list= MySqlGetList.GetDataList<MenuStripDomain>(data);
            //初始化节点
            MySqlBrushMenuStrip my = MySqlBrushMenuStrip.GetMyMySqlBrushMenuStrip(t);
            my.InitializeMenStrip(list, menuStrip);
        }
    }
}
